#include<bits/stdc++.h>//BAONI
using namespace std;
template<class T>void read(T &x)
{
	x=0;int f=0;char ch=getchar();
	while(ch<'0'||ch>'9') { f|=(ch=='-'); ch=getchar(); }
	while(ch<='9'&&ch>='0') { x=(x<<1)+(x<<3)+(ch^48); ch=getchar(); }
	x = f ? -x : x;
	return ;
}

int n,m,q,u,v,t;
double p;
priority_queue<int>qu;

int main()
{
	freopen("earthworm.in","r",stdin);
	freopen("earthworm.out","w",stdout);
	int k;
	read(n);read(m);read(q);read(u);read(v);read(t);
	p=(double)u/v;
	for(int i=1;i<=n;++i)
	{
		read(k);
		qu.push(k);
	}
	k=1;
	for(int i=1;i<=m;++i)
	{
		if(i==k*t)
		{
			printf("%d ",qu.top());
			k++;
		}
		int x=qu.top();
		qu.pop();
		int z=floor(x*p);
		qu.push(z);
		qu.push(x-z);
	}
	printf("\n");
	k=1;
	for(int i=1;i<=n+m;++i)
	{
		if(i==k*t)
		{
			printf("%d ",qu.top());
			k++;
		}
		qu.pop();
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
